package com.zynn.service.module.calculate.junit;

import org.assertj.core.util.Lists;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Vector;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * @author liqi
 */
public class ArrayClass {



    public static void main(String[] args) {

        /**
         *  arrayList 线程不安全
         *
         *
         */
//        List<String> stringList = Lists.newArrayList();

        // 创建一个线程安全的集合
        List<String> list = Collections.synchronizedList(new ArrayList<>());

        List<String> list1 = new Vector<>();
        list1.add("");

        // 线程安全
        List<String> copy = new CopyOnWriteArrayList<>();

        /**
         *
         * 1.Java
         *
         *
         */






    }



}
